<template>
  <li class="item">
    <h3>{{ item.title }}</h3>
    <p>
      {{ item.content }}
    </p>
    <div class="dataBox">
      <div class="user">
        <img :src="baseUrl + item.author.avatar" alt="" />
        {{ item.author.nickname }}
      </div>
      <div class="year">{{ item.created_at | myTime }}</div>
      <div class="read">
        <i class="iconfont iconicon_pinglunliang"></i>
        <span>{{ item.read }}</span>
      </div>
      <div class="star">
        <i class="iconfont iconbtn_dianzan_big_nor"></i>
        <span>{{ item.star }}</span>
      </div>
    </div>
  </li>
</template>

<script>
export default {
  name: 'shareItem',
  data () {
    return {
      baseUrl: process.env.VUE_APP_BaseURL
    }
  },
  props: ['item']
}
</script>

<style lang="less" scoped>
.item {
  padding: 15px 0 25px;
  border-bottom: 1px solid #f7f4f5;
  h3 {
    margin: 0;
    font-size: 16px;
    font-family: PingFangSC, PingFangSC-Medium;
    font-weight: 700;
    color: #181a39;
    line-height: 23px;
    letter-spacing: 0px;
  }
  p {
    margin: 10px 0 15px;
    font-size: 13px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #545671;
    line-height: 19px;
    letter-spacing: 0px;
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .dataBox {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #545671;
    line-height: 17px;
    .user {
      flex: 1;
      display: flex;
      align-items: center;
      img {
        height: 22px;
        width: 22px;
        border-radius: 50%;
      }
    }
    .year,
    .read,
    .star {
      display: flex;
      align-items: center;
    }
  }
}
</style>
